package cn.waqwb.s03;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Classname Student
 * @Description TODO
 * @Date 2022/9/15 19:20
 * @Created by Administrator
 */
@Component
public class Student {
    @Value("李四")
    private String name;
    @Value("21")
    private int age;
    //引用类型按类型注入
    @Autowired
    @Qualifier("schoolSub")
    private School school;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", school=" + school +
                '}';
    }
}
